﻿using System;
using System.Windows.Media;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Thinktecture.UIAnnotations;

namespace Demo
{
    public class PersonMetadata
    {
        [Required]
        [Editable(false)]
        [Display(Name = "PersonIdLabel", Description = "PersonIdDescription", ResourceType = typeof(Properties.Resources))]
        [DisplayFormat(DataFormatString = "#{0}")]
        public int Id { get; set; }

        [Required]
        [Editable(true)]
        [StringLength(10)]
        [Display(Name = "PersonNameLabel", Description = "PersonNameDescription", ResourceType = typeof(Properties.Resources))]
        [LocalizableDisplayFormat(NullDisplayText = "PersonNameNullDisplayText", ResourceType = typeof(Properties.Resources))]
        public string Name { get; set; }

        [Display(Name = "PersonBirthdayLabel", Description = "PersonBirthdayDescription", ResourceType = typeof(Properties.Resources))]
        [LocalizableDisplayFormat(NullDisplayText = "PersonBirthdayNullDisplayText", ResourceType = typeof(Properties.Resources))]
        public DateTime Birthday { get; set; }

        [Required]
        [Display(Name = "PersonDepartmentLabel", Description = "PersonDepartmentDescription", ResourceType = typeof(Properties.Resources))]
        [LocalizableDisplayFormat(NullDisplayText = "PersonDepartmentNullDisplayText", ResourceType = typeof(Properties.Resources))]
        [Association("Department", "Department", "Name")]
        public Department Department { get; set; }

        [Display(Name = "PersonImageLabel", Description = "PersonImageDescription", ResourceType = typeof(Properties.Resources))]
        public ImageSource Image { get; set; }
    }
}
